$(document).ready(function() {
	if (!console.log) {
		console.log = function() {

		};
	}
	$("#jt_header_left a").not("[class='on']").each(function() {
		$(this).hover(function() {
			$(this).addClass("on");
		}, function() {
			$(this).removeClass("on");
		});
	});
	
	$("#jt_header_left a.on").each(function() {
		$(this).attr("href", "#");
	});

	$('#addFavorite').click(function() {
		addFavorite(window.location.href, document.title);
	});
});

function addFavorite(sURL, sTitle) {
	var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd'
			: 'CTRL';
	if (document.all) {
		window.external.addFavorite(sURL, sTitle);
	} else if (window.sidebar) {
		window.sidebar.addPanel(sTitle, sURL, "");
	} else {
		alert("请使用" + ctrl + "+D收藏我们");
	}

	return false;
}
